import request from "@/utils/request";
/**
* @exports 添加用户（给用户追加角色）
* @param params 
* @returns Promise
*/
export const addUsers = (params: RoleRelUserParam) => {
    return request.post<RestResult<string>>("/mgt/role/addUsers", params);
}

/**
* @exports 角色删除
* @param params 
* @returns Promise
*/
export const deleteRole = (params: RestIdParam) => {
    return request.post<RestResult<string>>("/mgt/role/deleteRole", params);
}

/**
* @exports 角色详情-根据角色id查询
* @param params 
* @returns Promise
*/
export const detail = (params: RestIdParam) => {
    return request.post<RestResult<RoleVO>>("/mgt/role/detail", params);
}

/**
* @exports 权限树形结构
* @param params 
* @returns Promise
*/
export const permissionTreeList = (params: RestCommonParam) => {
    return request.post<RestResult<ListVO<TreeVO>>>("/mgt/role/permissionTreeList", params);
}

/**
* @exports 角色分页列表
* @param params 
* @returns Promise
*/
export const queryPageList = (params: RoleSearchParam) => {
    return request.post<RestResult<PageVO<RoleVO>>>("/mgt/role/queryPageList", params);
}

/**
* @exports 角色下拉列表
* @param params 
* @returns Promise
*/
export const roleDropDownList = (params: RoleDropDownParam) => {
    return request.post<RestResult<List<RoleVO>>>("/mgt/role/roleDropDownList", params);
}

/**
* @exports 角色新增
* @param params 
* @returns Promise
*/
export const save = (params: RoleSaveParam) => {
    return request.post<RestResult<IdVO>>("/mgt/role/save", params);
}

/**
* @exports 设置用户角色（给用户追加角色）
* @param params 
* @returns Promise
*/
export const settingUserRole = (params: RoleRelUserParam) => {
    return request.post<RestResult<string>>("/mgt/role/settingUserRole", params);
}

/**
* @exports 移除用户（给用户移除角色）
* @param params 
* @returns Promise
*/
export const unRelUsers = (params: RoleRelUserParam) => {
    return request.post<RestResult<string>>("/mgt/role/unRelUsers", params);
}

/**
* @exports 角色编辑
* @param params 
* @returns Promise
*/
export const update = (params: RoleSaveParam) => {
    return request.post<RestResult<string>>("/mgt/role/update", params);
}

/**
* @exports 角色-启用/禁用
* @param params 
* @returns Promise
*/
export const updateStatus = (params: UpdateStatusParam) => {
    return request.post<RestResult<string>>("/mgt/role/updateStatus", params);
}
